import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/couser_center/list_by_book_id_entity.dart';

ListByBookIdEntity $ListByBookIdEntityFromJson(Map<String, dynamic> json) {
  final ListByBookIdEntity listByBookIdEntity = ListByBookIdEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    listByBookIdEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    listByBookIdEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    listByBookIdEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    listByBookIdEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    listByBookIdEntity.deleted = deleted;
  }
  final String? directoryFile = jsonConvert.convert<String>(json['directoryFile']);
  if (directoryFile != null) {
    listByBookIdEntity.directoryFile = directoryFile;
  }
  final String? directoryName = jsonConvert.convert<String>(json['directoryName']);
  if (directoryName != null) {
    listByBookIdEntity.directoryName = directoryName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    listByBookIdEntity.id = id;
  }
  final String? resourceTypeDicId = jsonConvert.convert<String>(json['resourceTypeDicId']);
  if (resourceTypeDicId != null) {
    listByBookIdEntity.resourceTypeDicId = resourceTypeDicId;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    listByBookIdEntity.textbookId = textbookId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    listByBookIdEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    listByBookIdEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    listByBookIdEntity.updateDate = updateDate;
  }
  final bool? click = jsonConvert.convert<bool>(json['click']);
  if (click != null) {
    listByBookIdEntity.click = click;
  }
  final String? percentage = jsonConvert.convert<String>(json['percentage']);
  if (percentage != null) {
    listByBookIdEntity.percentage = percentage;
  }
  final int? totalDuration = jsonConvert.convert<int>(json['totalDuration']);
  if (totalDuration != null) {
    listByBookIdEntity.totalDuration = totalDuration;
  }
  final int? deadline = jsonConvert.convert<int>(json['deadline']);
  if (deadline != null) {
    listByBookIdEntity.deadline = deadline;
  }
  return listByBookIdEntity;
}

Map<String, dynamic> $ListByBookIdEntityToJson(ListByBookIdEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['directoryFile'] = entity.directoryFile;
  data['directoryName'] = entity.directoryName;
  data['id'] = entity.id;
  data['resourceTypeDicId'] = entity.resourceTypeDicId;
  data['textbookId'] = entity.textbookId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['click'] = entity.click;
  data['percentage'] = entity.percentage;
  data['totalDuration'] = entity.totalDuration;
  data['deadline'] = entity.deadline;
  return data;
}

extension ListByBookIdEntityExtension on ListByBookIdEntity {
  ListByBookIdEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? directoryFile,
    String? directoryName,
    String? id,
    String? resourceTypeDicId,
    String? textbookId,
    String? updateBy,
    String? updateById,
    String? updateDate,
    bool? click,
    String? percentage,
    int? totalDuration,
    int? deadline,
  }) {
    return ListByBookIdEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..directoryFile = directoryFile ?? this.directoryFile
      ..directoryName = directoryName ?? this.directoryName
      ..id = id ?? this.id
      ..resourceTypeDicId = resourceTypeDicId ?? this.resourceTypeDicId
      ..textbookId = textbookId ?? this.textbookId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..click = click ?? this.click
      ..percentage = percentage ?? this.percentage
      ..totalDuration = totalDuration ?? this.totalDuration
      ..deadline = deadline ?? this.deadline;
  }
}
